<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String path = request.getContextPath();
String actionId = (String) request.getAttribute("actionId");
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=path%>/resource/iKindEditor/editor/plugins/code/prettify.css" />
<link rel="stylesheet" href="<%=path%>/resource/iKindEditor/editor/themes/default/default.css" />

<script charset="utf-8" src="<%=path%>/resource/js/jquery/jquery-1.8.2.js"></script>
<script charset="utf-8" src="<%=path%>/resource/iKindEditor/editor/kindeditor.js"></script>
<script charset="utf-8" src="<%=path%>/resource/iKindEditor/editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="<%=path%>/resource/iKindEditor/editor/plugins/code/prettify.js"></script>
<script charset="utf-8" src="<%=path%>/resource/js/articleEditor.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#submitSummarizeButton").click(doSubmitSummarize);
});

function doSubmitSummarize() {
	articleEditor_inputEditor.sync(); // 将编辑框中的内容同步到textarea编辑框中来
	//var content = $("#inputTextArea").val();
	var content = articleEditor_inputEditor.text().replace(new RegExp("<\\s*img\\s+([^>]*)>", 'g'), "").replace(new RegExp("<\\s*embed\\s+([^>]*)>", 'g'), "");
	var actionId = $("#actionId").val();
	alert(content);
	if (content && "" != content && jQuery.trim(content) != "" && actionId && "" != actionId) {
		if (checkStr(content)) {
			alert("请规范化数据,不能加入<script>等脚本语言");
		} else {
			$("#summarizeForm").submit();
		}
	}
}

function checkStr(str) {
	var reg = new RegExp("<.*?script[^>]*?>.*?(<\/.*?script.*?>)*","ig");
	
	return reg.test(str);
}
</script>
<title>聚餐活动总结</title>
<style type="text/css">
body{
color: #333333;
font-family: "微软雅黑"
}
</style>
</head>
<body>
	<div style="width: 800px; min-height: 600px; height: auto!important; height: 600px; margin: auto; margin-top: 20px;">
		<div style="width: 800px; height: 40px; line-height: 40px; background: #F0F0EE; text-align: center; border: 1px solid #CCCCCC; border-bottom: 1px solid #F0F0EE;">发布聚餐活动总结</div>
		<form action="<%=path%>/play/dine/admin/addSummarize" method="post" id="summarizeForm">
			<input type="hidden" id="actionId" name="actionId" value="<%=actionId %>" />
			<div>
				<textarea id="inputTextArea" name="content" style="display: bolck; width:800px; height:600px;"></textarea>
			</div>
			<div>
				<input type="button" value="发布" id="submitSummarizeButton" />
			</div>
		</form>
	</div>
</body>
</html>